package com.集合.student;

import java.util.ArrayList;
import java.util.Scanner;

public class StudentArrPuls {
    public static void main(String[] args) {
        ArrayList<Student> arrayList = new ArrayList<>();

        for (int i = 0; i < 3; i++) {
            Scanner scanner = new Scanner(System.in);
            //请输入名字
            System.out.println("请输入名字");
            String name = scanner.next();

            //请输入年龄
            System.out.println("请输入年龄");
            int age1 = scanner.nextInt();

            Student student = new Student();
            student.setName(name);
            student.setAge(age1);

            arrayList.add(student);
        }

        System.out.println(arrayList);

    }
}
